General

Components

Community

Development

TDF

Documents > Cookbook >Presentation Document



Create Presentation Document
Let's create an empty presentation document first. The following codes generates an empty presentation document with one slide:

		    PresentationDocument document=PresentationDocument.newPresentationDocument();	 
document.save(filePath);

We can also create a presentation template document by using the following codes. The operation of the template document is the same with the normal presentation document.

                    PresentationDocument documentTmp=PresentationDocument.newPresentationTemplateDocument();			    


Get Presentation Document
We can get the existing presentation Document by using the loadDocument function like follows:
Here presentation.odp is the name of the existing presentation document.
Also we can append all the slides of the specified presentation document to the current document by using the following codes:
Here the slides of the documents "presentation.odp" will be appended to "document".

		    PresentationDocument presentationmodel;
presentationmodel=(PresentationDocument)PresentationDocument.loadDocument("presentation.odp");
document.appendPresentation(presentationmodel);


Change Presentation Mode
We can switch the mode presentation documents by using the following codes. Here the first one convert the presentation document to a template, and the second one convert the template to a normal presentation document.

		    document.changeMode(OdfMediaType.PRESENTATION_TEMPLATE);	
documentTmp.changeMode(OdfMediaType.PRESENTATION);


Impressum (Legal Info) | Privacy Policy (Datenschutzerklärung) | Statutes (non-binding English translation) - Satzung (binding German version) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Apache License, v2.0. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License v2.0. “LibreOffice” and “The Document Foundation” are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy. LibreOffice was based on OpenOffice.org.